import request from '@/config/axios'

// ERP基础资料-辅料类型 VO
export interface BaseAccessoryMaterialTypeVO {
  id: string // 类型ID
  typeCode: string // 类型编号
  typeName: string // 类型名称
  remark: string // 备注
  parentId: string // 上级ID
}

// ERP基础资料-辅料类型 API
export const BaseAccessoryMaterialTypeApi = {
  // 查询ERP基础资料-辅料类型列表
  getBaseAccessoryMaterialTypeList: async (params) => {
    return await request.get({ url: `/erp/base-accessory-material-type/list`, params })
  },

  // 查询ERP基础资料-辅料类型详情
  getBaseAccessoryMaterialType: async (id: number) => {
    return await request.get({ url: `/erp/base-accessory-material-type/get?id=` + id })
  },

  // 新增ERP基础资料-辅料类型
  createBaseAccessoryMaterialType: async (data: BaseAccessoryMaterialTypeVO) => {
    return await request.post({ url: `/erp/base-accessory-material-type/create`, data })
  },

  // 修改ERP基础资料-辅料类型
  updateBaseAccessoryMaterialType: async (data: BaseAccessoryMaterialTypeVO) => {
    return await request.put({ url: `/erp/base-accessory-material-type/update`, data })
  },

  // 删除ERP基础资料-辅料类型
  deleteBaseAccessoryMaterialType: async (id: number) => {
    return await request.delete({ url: `/erp/base-accessory-material-type/delete?id=` + id })
  },

  // 导出ERP基础资料-辅料类型 Excel
  exportBaseAccessoryMaterialType: async (params) => {
    return await request.download({ url: `/erp/base-accessory-material-type/export-excel`, params })
  }
}